/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.diamondsys.embrapa;

import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

/**
 *
 * @author Rafael
 */
@Stateless
public class RhTbFuncionarioFacade extends AbstractFacade<RhTbFuncionario> {
    @PersistenceContext(unitName = "com.diamondsys_embrapa_war_1.0-SNAPSHOTPU")
    private EntityManager em;

    @Override
    public EntityManager getEntityManager() {
        return em;
    }

    public RhTbFuncionarioFacade() {
        super(RhTbFuncionario.class);
    }
    
    public List<RhTbFuncionario> getAllOrdenadoNome() {
        return em.createQuery("SELECT r FROM RhTbFuncionario r  WHERE r.ativoFunc = 'S' ORDER BY r.nomeFunc ASC", RhTbFuncionario.class)
                .getResultList();
    } 
}
